﻿using System;
using System.Web.Mvc;
using bezlimitu.App_Code;
using System.Threading.Tasks;

namespace bezlimitu.Controllers
{
    public class HomeController : AsyncController
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }
        public string Download()
        {
            RapidgatorAgent rapid = new RapidgatorAgent("http://rapidgator.net/file/66276954/Star.3.GpSHoT.part1.rar",
                "heapjack@aol.com", "sponge");
            if (rapid.LogIn())
            {
                return "Błąd\n"+rapid.ResponseLogin;
            }
            else
                return "Błąd logowania!\n"+rapid.ResponseLogin;
        }

        public String RapidgatorInfo()
        {
            TurbobitAgent rapid = new TurbobitAgent("http://turbobit.net/r9sgvgpllcdm/Call.Of.Duty.Black.Ops.II.2012.POLiSH.O22y.part03.rar.html",
                "justwatch", "goodfiles");
            if (rapid.LogIn())
            {
                DownloadLink dl = rapid.GetFileInfo();
                dl.DownloadToClient();
                return dl.Name;
            }
            return "dupa";
        }
    }

}